<style>
  .autoheight .demo-slide {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, #5193e9, #0e61cd);
    color: #fff;
    font-size: 48px;
  }

  .autoheight .demo-slide:nth-child(2n) {
    background: linear-gradient(to bottom right, #0e61cd, #5193e9);
    height: 500px;
  }
</style>

<div class="autoheight">
  <b-carousel navigation auto-height>
    <div class="demo-slide">1</div>
    <div class="demo-slide">2</div>
    <div class="demo-slide">3</div>
    <div class="demo-slide">4</div>
    <div class="demo-slide">5</div>
  </b-carousel>
</div>